<template>

    <div>
        <el-button  @click="btn">B的按钮</el-button>
        <!--<C v-bind="$attrs" v-on="$listeners"></C>-->
    </div>
</template>

<script>
  import C from  "./C"
    export default {

      name: "B",
      inheritAttrs: false,
      components:{
        C
      },
      created() {
        // console.log(this.age)
        // console.log(this.name)
        // console.log(this.$attrs)
      },
      methods:{
        btn(){
          console.log(this.$attrs)
          // console.log(this.$listeners)
          // this.$emit("btoa","btoa")
          this.$emit("Aevent") // 子组件触发爷组件的方法
          // this.$emit("Bevent") // 子组件触发父组件的方法
        }
      }
    }
</script>

<style scoped>

</style>
